<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
        
<?php
require("ArrayTest.php");
?>
        
    </head>
    <body>
        <?php
            echo "Example 1<br />";
            $fixture = Array();
            //$fixture is expected to be empty
            print sizeof($fixture);
            $fixture[] = 'element';
            //$fixture is expected to contain one element
            print sizeof($fixture);
            //destroy $fixture
            unset($fixture);
            print "Example 2\n";
             $fixture = Array();
            //$fixture is expected to be empty
            print sizeof($fixture) == 0 ? "ok\n" : "not ok\n";
            $fixture[] = 'element';
            //$fixture is expected to contain one element
            print sizeof($fixture) == 1 ? "ok\n" : "not ok\n";
            
            
             $fixture = Array();
            //$fixture is expected to be empty
            assertTrue(sizeof($fixture) == 0);
            $fixture[] = 'element';
            //$fixture is expected to contain one element
            assertTrue(sizeof($fixture) == 1);
            //destroy $fixture
            unset($fixture);
            function assertTrue($condition){
                if(!$condition){
                    throw new Exception("Assertion failed");
                }                     
            }
            $arrayTest = new ArrayTest();
            $arrayTest->testNewArrayIsEmpty();
            $arrayTest->testArrayContainsAnElement();
        ?>
    </body>
</html>
